package com.example.mybatisdemo4allpractice.util;

import com.example.mybatisdemo4allpractice.pojo.Registry;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;

/**
 * 工具类
 *
 * @author 27013
 **/


public class MybtiasUtil {
   public  static SqlSession  createdSession() throws IOException {
       return new SqlSessionFactoryBuilder().build(
               Resources.getResourceAsStream("mybatis-config.xml")
       ).openSession(true);
   };

}
